<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>
    <cpn v-bind:c-info="info"></cpn>
</div>

<template id="cpn">
    <div>
        <h2>{{cInfo}}</h2>
    </div>
</template>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>

    // 官网介绍：https://cn.vuejs.org/v2/guide/components-props.html#Prop-%E7%9A%84%E5%A4%A7%E5%B0%8F%E5%86%99-camelCase-vs-kebab-case
    const cpn = {
        template: '#cpn',
        props: {
            cInfo: {
                type: Object,
                default() {
                    return {};
                }
            }
        }
    }

    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu',
            info: {
                name: 'kai',
                age: 19
            }
        },
        components: {
            cpn
        }
    })
</script>
</body>
</html>